﻿using System;

namespace kongzhitaicalculation
{
    class Program
    {
        static void Main(string[] args)
        {
            double a;
            double b;
            string op;
            double result=0;
            string reset = string.Empty;
            do
            {
                Console.WriteLine("Enter the first number:");
                a = double.Parse(Console.ReadLine());
                Console.WriteLine("Enter the op:");
                op = Console.ReadLine();
                Console.WriteLine("Enter the second number:");
                b = double.Parse(Console.ReadLine());
                switch (op)
                {
                    case "+": result = a + b; break;
                    case "-": result = a - b; break;
                    case "*": result = a * b; break;
                    case "/": if (b != 0) { result = a / b; } else { Console.WriteLine("Error!The denominator shouldn't be zero!"); } break;
                }
                if ((op == "/") && (b == 0)) { Console.WriteLine("There won't be result!"); } else { Console.WriteLine("结果是" + result); }
                Console.WriteLine("输入数字0退出，输入其他任意值继续使用");
                reset = Console.ReadLine();
            } while (reset != "0");

            
        }
    }
}
